home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / daemons / nfs / nfs-serv.2be / nfs-serv / nfs-server-2.2beta16 / Makefile.in < prev    next >
Encoding:
Makefile  |  1996-05-20  |  8.3 KB  |  286 lines

  1. # Makefile for the Universal NFS Server.    -*- Indented-Text -*-
  2. # Copyright (C) 1993 Rick Sladkey.
  3.  
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8.  
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13.  
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. #### Start of system configuration section. ####
  19.  
  20. srcdir = @srcdir@
  21. VPATH = @srcdir@
  22.  
  23. CC = @CC@
  24. AR = ar
  25. RANLIB = @RANLIB@
  26.  
  27. INSTALL = @INSTALL@
  28. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  29. INSTALL_DATA = @INSTALL_DATA@
  30. MAKEINFO = makeinfo
  31. TEXI2DVI = texi2dvi
  32. RPCGEN = @RPCGEN@ @RPCGEN_C@
  33.  
  34. # General compile options and libs:
  35. DEFS = @DEFS@ $(NFSD_DEFS)
  36. LIBS = libnfs.a @LIBS@
  37.  
  38. # Compile options for nfsd:
  39. # CALL_PROFILING
  40. #    Profiles all NFS RPC calls in the server. Statistics can be dumped
  41. #    to /tmp/nfsd.profile by sending a SIGIOT to the server.
  42. # DOSHACKS
  43. #    This is a hack that lets DOS boxes mount NFS volumes with all_squash
  44. #    enabled and actually write to them, even though their uid/gid does
  45. #    not match the non_uid/anon_gid. Ugly, and not officially supported.
  46. #    (Don't you call me a hypocrite:)
  47. # DEBUG
  48. #    General debugging enable flag
  49. #NFSD_DEFS = -DCALL_PROFILING
  50. NFSD_DEFS =
  51.  
  52. CFLAGS = -O
  53. LDFLAGS = -s
  54. WARNFLAGS = @WARNFLAGS@
  55. RPC_WARNFLAGS = @RPC_WARNFLAGS@
  56. TRANSPORTFLAGS = @RPCGEN_I@ -s udp -s tcp
  57.  
  58. prefix = /usr
  59. exec_prefix = $(prefix)
  60.  
  61. bindir = $(exec_prefix)/sbin
  62. infodir = $(prefix)/info
  63. man5dir = $(prefix)/man/man5
  64. man5ext = .5
  65. man8dir = $(prefix)/man/man8
  66. man8ext = .8
  67.  
  68. # Prefix to be prepended to each installed RPC program, normally `rpc.'.
  69. rpcprefix = rpc.
  70. # Prefix to be prepended to each installed program, normally empty or `g'.
  71. binprefix = 
  72.  
  73. #### End of system configuration section. ####
  74.  
  75. # include site-specific defintions generated by BUILD.
  76. include site.mk
  77.  
  78. SHELL = /bin/sh
  79.  
  80. SRCS        = version.c logging.c fh.c auth_init.c auth_clnt.c auth.c \
  81.           nfsd.c nfs_dispatch.c getattr.c setattr.c \
  82.           mountd.c mount_dispatch.c \
  83.           ugid_clnt.c ugid_map.c ugid_xdr.c ugidd.c \
  84.           rquotad.c rquota_dispatch.c rquota_xdr.c \
  85.           rpcmisc.c rmtab.c showmount.c
  86. LIBSRCS        = fileblocks.c fsusage.c realpath.c strerror.c \
  87.           utimes.c mkdir.c rename.c getopt.c getopt1.c \
  88.           alloca.c eaccess.c mountlist.c xmalloc.c \
  89.           xstrdup.c strdup.c strstr.c nfsmounted.c faccess.c
  90. XDRFILES    = mount.x nfs_prot.x
  91. GENFILES    = mount.h mount_xdr.c mount_svc.c nfs_prot.h nfs_prot_xdr.c \
  92.           ugid.h ugid_xdr.c ugid_clnt.c
  93. HDRS        = system.h nfsd.h auth.h fh.h logging.h fakefsuid.h \
  94.           rpcmisc.h faccess.h rquotad.h rquota.h
  95. LIBHDRS        = fsusage.h getopt.h mountlist.h
  96. MANPAGES5    = exports
  97. MANPAGES8    = mountd nfsd showmount $(UGIDD_MAN)
  98. MANPAGES    = $(MANPAGES5) $(MANPAGES8)
  99. LIBOBJS        = version.o getopt.o getopt1.o eaccess.o \
  100.           fsusage.o mountlist.o xmalloc.o xstrdup.o \
  101.           nfsmounted.o faccess.o @LIBOBJS@ @ALLOCA@
  102. OBJS        = logging.o fh.o auth_init.o auth_clnt.o auth.o
  103. NFSD_OBJS    = nfsd.o rpcmisc.o nfs_dispatch.o getattr.o setattr.o \
  104.           nfs_prot_xdr.o ugid_clnt.o ugid_map.o ugid_xdr.o $(OBJS)
  105. MOUNTD_OBJS    = mountd.o rpcmisc.o mount_dispatch.o mount_xdr.o rmtab.o \
  106.           $(OBJS)
  107. SHOWMOUNT_OBJS    = showmount.o mount_xdr.o
  108. UGIDD_OBJS    = ugidd.o ugid_xdr.o logging.o
  109. RQUOTAD_OBJS    = rquotad.o rquota_xdr.o rquota_dispatch.o rpcmisc.o \
  110.           logging.o
  111. DAEMONS        = $(rpcprefix)mountd $(rpcprefix)nfsd $(UGIDD_PROG) \
  112.           $(RQUOTAD_PROG)
  113. CLIENTS        = showmount
  114.  
  115. DISTFILES    = $(SRCS) $(HDRS) $(MANPAGES) \
  116.           $(XDRFILES) $(LIBSRCS) $(LIBHDRS) \
  117.           ChangeLog README NEWS TODO INSTALL COPYING \
  118.           Makefile.in configure.in aclocal.m4 acconfig.h \
  119.           config.h.in configure mkinstalldirs
  120.  
  121. all: $(rpcprefix)mountd $(rpcprefix)nfsd showmount $(UGIDD_PROG)
  122. .PHONY: all
  123.  
  124. .PHONY: info dvi
  125. info: nfs-server.info
  126. dvi: nfs-server.dvi
  127.  
  128. COMPILE = $(CC) -c $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) $(CFLAGS) $(WARNFLAGS)
  129.  
  130. .c.o:
  131.     $(COMPILE) $<
  132.  
  133. .PHONY: install installdirs
  134. install: $(DAEMONS) $(CLIENTS) installdirs
  135.     @for prog in $(DAEMONS) $(CLIENTS); do \
  136.         echo "installing $$prog in $(bindir)";    \
  137.         $(INSTALL_PROGRAM) $$prog $(bindir)/$$prog;    \
  138.     done
  139.     @for manp in $(MANPAGES5); do            \
  140.         echo "installing $$manp$(man5ext) in $(man5dir)";    \
  141.         $(INSTALL_DATA) $(srcdir)/$$manp.man    \
  142.             $(man5dir)/$$manp$(man5ext); \
  143.     done
  144.     @for manp in $(MANPAGES8); do            \
  145.         echo "installing $$manp$(man8ext) in $(man8dir)";    \
  146.         $(INSTALL_DATA) $(srcdir)/$$manp.man    \
  147.             $(man8dir)/$$manp$(man8ext);         \
  148.         if [ 'x$(rpcprefix)' != 'x' ]; then \
  149.             rm -f $(man8dir)/$(rpcprefix)$$manp$(man8ext); \
  150.             ln $(man8dir)/$$manp$(man8ext) \
  151.                 $(man8dir)/$(rpcprefix)$$manp$(man8ext); \
  152.         fi; \
  153.     done
  154.  
  155. installdirs:
  156.     ${srcdir}/mkinstalldirs $(bindir) $(man5dir) $(man8dir)
  157.  
  158. $(rpcprefix)mountd: $(MOUNTD_OBJS) libnfs.a
  159.     $(CC) $(LDFLAGS) -o $@ $(MOUNTD_OBJS) $(LIBS)
  160.  
  161. $(rpcprefix)nfsd: $(NFSD_OBJS) libnfs.a
  162.     $(CC) $(LDFLAGS) -o $@ $(NFSD_OBJS) $(LIBS)
  163.  
  164. $(rpcprefix)ugidd: $(UGIDD_OBJS) libnfs.a
  165.     $(CC) $(LDFLAGS) -o $@ $(UGIDD_OBJS) $(LIBS) \
  166.         $(LIBWRAP_DIR) $(LIBWRAP_LIB)
  167.  
  168. $(rpcprefix)rquotad: $(RQUOTAD_OBJS) libnfs.a
  169.     $(CC) $(LDFLAGS) -o $@ $(RQUOTAD_OBJS) $(LIBS)
  170.  
  171. showmount: $(SHOWMOUNT_OBJS) libnfs.a
  172.     $(CC) $(LDFLAGS) -o $@ $(SHOWMOUNT_OBJS) $(LIBS)
  173.  
  174. version.c: .version
  175.     VERSION=`cat .version`; \
  176.     echo "char version[] = \"Universal NFS Server $$VERSION\";" > version.c
  177.  
  178. nfs_prot.h: nfs_prot.x
  179.     rm -f $@
  180.     $(RPCGEN) -h -o $@ $?
  181. nfs_prot_xdr.c: nfs_prot.x
  182.     rm -f $@
  183.     $(RPCGEN) -c $? | \
  184.         sed 's;^#include ".*/nfs_prot.h"$$;#include "nfs_prot.h";' >$@
  185.  
  186. mount.h: mount.x
  187.     rm -f $@
  188.     $(RPCGEN) -h -o $@ $?
  189. mount_xdr.c: mount.x
  190.     rm -f $@
  191.     $(RPCGEN) -c $? | \
  192.           sed 's;^#include ".*/mount.h"$$;#include "mount.h";' >$@
  193. mount_svc.c: mount.x
  194.     rm -f $@
  195.     $(RPCGEN) -m $? | \
  196.         sed 's;^#include ".*/mount.h"$$;#include "mount.h";' >$@
  197.  
  198. ugid.h:    ugid.x
  199.     rm -f $@
  200.     $(RPCGEN) -h -o $@ $?
  201. ugid_xdr.c: ugid.x
  202.     rm -f $@
  203.     $(RPCGEN) -c $? | \
  204.           sed 's;^#include ".*/ugid.h"$$;#include "ugid.h";' >$@
  205. ugid_clnt.c: ugid.x
  206.     rm -f $@
  207.     $(RPCGEN) -l -o $@ $?
  208.  
  209. nfs_prot_xdr.o: nfs_prot_xdr.c
  210.     $(COMPILE) $(RPC_WARNFLAGS) -c nfs_prot_xdr.c
  211. mount_xdr.o: mount_xdr.c
  212.     $(COMPILE) $(RPC_WARNFLAGS) -c mount_xdr.c
  213. mount_svc.o: mount_svc.c
  214.     $(COMPILE) $(RPC_WARNFLAGS) -c mount_svc.c
  215. ugid_xdr.o: ugid_xdr.c
  216.     $(COMPILE) $(RPC_WARNFLAGS) -c ugid_xdr.c
  217. ugid_clnt.o: ugid_clnt.c
  218.     $(COMPILE) $(RPC_WARNFLAGS) -c ugid_clnt.c
  219.  
  220. $(MOUNTD_OBJS): config.h nfs_prot.h mount.h
  221. $(NFSD_OBJS): config.h nfs_prot.h mount.h
  222. $(SHOWMOUNT_OBJS): config.h mount.h
  223. ugid_map.o ugid_clnt.o: config.h ugid.h
  224. $(UGIDD_OBJS): config.h ugid.h
  225. ugidd.o: ugidd.c
  226.     $(COMPILE) $(UGIDD_DEFS) -c ugidd.c
  227.  
  228. libnfs.a: $(LIBOBJS)
  229.     rm -f $@
  230.     $(AR) cr $@ $(LIBOBJS)
  231.     -$(RANLIB) $@
  232.  
  233. nfs-server.info: nfs-server.texi
  234.     $(MAKEINFO) -I$(srcdir) -o nfs-server.info $(srcdir)/nfs-server.texi
  235. nfs-server.dvi: nfs-server.texi
  236.     $(TEXI2DVI) $(srcdir)/nfs-server.texi
  237.  
  238. README: README.mm
  239.     groff -mgm -Tascii README.mm | col -b > README
  240.  
  241. .PHONY: check
  242. check: nfs-server
  243.     @echo nothing to check
  244.  
  245. # this causes nothing but grief
  246. #Makefile: Makefile.in config.h.in config.status
  247. #    $(SHELL) config.status
  248. #config.status: configure
  249. #    $(SHELL) config.status --recheck
  250. #configure: configure.in aclocal.m4
  251. #    cd $(srcdir) && autoconf
  252. #config.h.in: configure.in acconfig.h
  253. #    cd $(srcdir) && autoheader
  254.  
  255. TAGS: $(SRCS)
  256.     etags $(SRCS)
  257.  
  258. .PHONY: clean mostlyclean distclean realclean dist
  259.  
  260. clean:
  261.     rm -f $(rpcprefix)mountd $(rpcprefix)nfsd
  262.     rm -f $(rpcprefix)ugidd $(rpcprefix)rquotad
  263.     rm -f showmount 
  264.     rm -f *.o libnfs.a core
  265.     rm -f nfs-server.dvi nfs-server.?? nfs-server.??s
  266.     rm -f $(GENFILES)
  267.  
  268. mostlyclean: clean
  269.  
  270. distclean: clean
  271.     rm -f Makefile config.status config.cache config.log site.h site.mk
  272.  
  273. realclean: distclean
  274.     rm -f TAGS nfs-server.info*
  275.  
  276. dist: $(DISTFILES)
  277.     echo nfs-server-`sed -e '/version/!d' -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
  278.     rm -rf `cat .fname`
  279.     mkdir `cat .fname`
  280.     ln $(DISTFILES) `cat .fname`
  281.     tar chzf `cat .fname`.tar.gz `cat .fname`
  282.     rm -rf `cat .fname` .fname
  283.  
  284. # Prevent GNU make v3 from overflowing arg limit on SysV.
  285. .NOEXPORT:
  286.